// demo 参考用

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
//   entry: './src/index.js'
//   ,output: {
//     filename: 'bundle.js'	// 此文件名会替换 main.js
//     ,path: path.resolve(__dirname, 'build')     // 原值 dist
//   }
    mode: 'development'
    ,entry: {
        app: './src/index.js',
        print: './src/print.js'
    }
    ,output: {
        filename: '[name].bundle.js'
        ,path: path.resolve(__dirname, 'dist')
        ,publicPath: '/'
    }
    ,devtool: 'inline-source-map'
    ,devServer: {
        static: './dist'
        ,port: 8888
    }
    ,plugins: [
        new HtmlWebpackPlugin({
            title: 'Development'
        })
    ]
    ,module: {
        rules: [{
            test: /\.css$/
            ,use: [
                'style-loader'
                ,'css-loader'
            ]
        }, {
            test: /\.(png|svg|jpg|gif)$/
            ,use: [
                'file-loader'
            ]
        }]
    }
};